package com.example.xpvideo.service.serviceImpl;

import com.example.xpvideo.entity.LsGoodsComment;
import com.example.xpvideo.mapper.LsGoodsCommentMapper;
import com.example.xpvideo.service.LsGoodsCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * (LsGoodsComment)Service层
 *
 * @author 杨丽辉
 * @since 2021-08-18 11:05:48
 */
@Service
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class LsGoodsCommentServiceImpl implements LsGoodsCommentService {
        @Autowired
        private LsGoodsCommentMapper lsGoodsCommentMapper;


 /**
     * 通过ID和其他条件查询单条数据
     *
     * @param lsGoodsComment 实例对象
     * @return 实例对象
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
     public LsGoodsComment queryLsGoodsCommentLimit1(LsGoodsComment lsGoodsComment){
     return  lsGoodsCommentMapper.queryLsGoodsCommentLimit1( lsGoodsComment);
     }
     
 /**
     * 查询指定行数据
     * @param lsGoodsComment 实例对象
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public   List<LsGoodsComment> queryAllLsGoodsCommentByLimit( LsGoodsComment lsGoodsComment, Integer offset,  Integer limit){
   return lsGoodsCommentMapper.queryAllLsGoodsCommentByLimit(lsGoodsComment, offset,limit);
  }

  /**
     * 查询数据条数
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public int countAllLsGoodsComment(LsGoodsComment lsGoodsComment){
   return lsGoodsCommentMapper.countAllLsGoodsComment( lsGoodsComment);
   }
   /**
     * 通过实体作为筛选条件查询
     *
     * @param lsGoodsComment 实例对象
     * @return 对象列表
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public List<LsGoodsComment> queryAllLsGoodsComment(LsGoodsComment lsGoodsComment){
   return lsGoodsCommentMapper.queryAllLsGoodsComment(lsGoodsComment);
   }
  /**
     * 新增数据
     *
     * @param lsGoodsComment 实例对象
     * @return 影响行数
     */
     @Override
   @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
    public int insertLsGoodsComment(LsGoodsComment lsGoodsComment){
    return  lsGoodsCommentMapper.insertLsGoodsComment( lsGoodsComment);
    }
  /**
     * 修改数据
     *
     * @param lsGoodsComment 实例对象
     * @return 影响行数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
     public  int updateLsGoodsComment(LsGoodsComment lsGoodsComment){
         return lsGoodsCommentMapper.updateLsGoodsComment( lsGoodsComment);
     }

    /**
     * 通过主键删除数据
     * @param id 主键
     * @return 影响行数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  int deleteLsGoodsCommentById(Integer id){
   return  lsGoodsCommentMapper.deleteLsGoodsCommentById( id);
   }
     /**
     * 通过主键列表删除，列表长度不能为0
     * @param list 集合
     * @return 条数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public  int deleteLsGoodsCommentByIds( List<Integer> list){
    return  lsGoodsCommentMapper.deleteLsGoodsCommentByIds(  list);
  }
    
       /**
     * 通过主键修改实体列表，列表长度不能为0，注意：当实体属性为null时，对应的列也会别更新为null
     * @param list 集合
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public int updateLsGoodsCommentBatch( List<LsGoodsComment> list){
   return  lsGoodsCommentMapper.updateLsGoodsCommentBatch(list);
   }
    /**
     * 批量其他列,除主键以外的列，列表长度不能为0,字段是空的就置为null
     * @param list 集合
     * @return 条数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
 public   int insertLsGoodsCommentBatch( List<LsGoodsComment> list){
 return lsGoodsCommentMapper.insertLsGoodsCommentBatch( list);
 }
      /**
     * 通过实体非空属性删除
     * @param lsGoodsComment  实体
     * @return 条数
     */
        @Override
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public   int deleteLsGoodsCommentByEntity( LsGoodsComment lsGoodsComment){
  return  lsGoodsCommentMapper.deleteLsGoodsCommentByEntity(  lsGoodsComment);
  }
    /**
     * 通过实体不为空的属性作为筛选条件查询列表
     * @param lsGoodsComment  实体
     * @return list
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  List<LsGoodsComment> listLsGoodsCommentByEntity(LsGoodsComment lsGoodsComment){
   return lsGoodsCommentMapper.listLsGoodsCommentByEntity( lsGoodsComment);
   }

 /**
     * 新增实体属性不为null的列
     * @param lsGoodsComment  实体
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  int insertLsGoodsCommentSelect( LsGoodsComment lsGoodsComment){
      return lsGoodsCommentMapper.insertLsGoodsCommentSelect( lsGoodsComment);

   }
   
      /**
     * 批量新增新增实体属性不为null的列
     * @param list  实体
     * @return 条数
     */
        @Override
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public  int insertLsGoodsCommentListSelect( List<LsGoodsComment> list){

     return lsGoodsCommentMapper.insertLsGoodsCommentListSelect( list);
      }
     /**
     * 通过实体不为空的属性作为筛选条件查询单个
     * @param lsGoodsComment  实体
     * @return 单个
     */
     @Override
   @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
    public  LsGoodsComment getLsGoodsCommentByEntity(LsGoodsComment lsGoodsComment){
     return  lsGoodsCommentMapper.getLsGoodsCommentByEntity(lsGoodsComment);
    }

}

